#!/bin/bash -e

function info() {
echo Usage: `basename $0` '[-i ip] py'
exit 1
}

while getopts  ":p:f:i:" opt; do
	case  $opt  in
		p) out_prefix=$OPTARG;;
        i) ip=$OPTARG;;
		f) suffix=$OPTARG;;
		*) info;;
	esac
done
shift $(($OPTIND - 1))


if [ $# -lt 1 ]; then info; fi


virtual=~/virtual/web
. $virtual/bin/activate


export FLASK_APP=$1
export FLASK_DEBUG=true

host=${host:=192.168.10.113}
port=${port:=5000}
flask run -h $host -p $port
